cmake_minimum_required(VERSION 3.0.2)
project(rune)

set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++17")

find_package(catkin REQUIRED COMPONENTS
rm_interfaces
roscpp
sensor_msgs
geometry_msgs
cv_bridge_new
message_filters
dynamic_reconfigure
tf2
tf2_ros
tf2_geometry_msgs
)
find_package(OpenCV REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(fmt REQUIRED)
find_package(Ceres REQUIRED)

catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES rune
#  CATKIN_DEPENDS rm_interfaces roscpp std_msgs
#  DEPENDS system_lib
)

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
  ${EIGEN3_INCLUDE_DIRS}
  ${CERES_INCLUDE_DIRS}
)

set(RUNE_DETECTOR_SRC
"rune_detector_main.cpp"
)
add_executable(rune_detector_node ${RUNE_DETECTOR_SRC})
add_dependencies(rune_detector_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(rune_detector_node configures_gencfg)
target_include_directories(rune_detector_node PUBLIC
  ${CMAKE_CURRENT_SOURCE_DIR}/rune_detector/include
)
target_link_libraries(rune_detector_node
  ${catkin_LIBRARIES}
  ${OpenCV_LIBS}
  ${CERES_LIBRARIES}
  fmt::fmt
)

set(SOLVE_RUNE_SRC
"rune_detector_main.cpp"
)
add_executable(solve_rune_node ${SOLVE_RUNE_SRC})
add_dependencies(solve_rune_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(solve_rune_node configures_gencfg)
target_include_directories(solve_rune_node PUBLIC
  ${CMAKE_CURRENT_SOURCE_DIR}/solve_rune/include
)
target_link_libraries(solve_rune_node
  ${catkin_LIBRARIES}
  ${OpenCV_LIBS}
  ${CERES_LIBRARIES}
  fmt::fmt
)



